1. Field of the Invention
The present invention relates to bit stuffing in serial data transfer protocols, and more particularly, to a method for bit stuffing in parallel.
2. Background Information
The Universal Serial Bus (USB) is a cable bus that supports data exchange between a host computer (USB host) and a wide range of simultaneously accessible peripherals (USB devices). The USB physical interconnect is a tiered star topology. A hub is at the center of each star. Each wire segment is a point-to-point connection between the USB host and a hub or USB device, or a USB hub connected to another hub or USB device. The USB host contains host controllers that provide access to the USB devices in the system.
The current USB specification employs non-return to zero invert (NRZI) data encoding when transmitting packets. In NRZI encoding, a xe2x80x9c1xe2x80x9d is represented by no change in voltage level and a xe2x80x9c0xe2x80x9d is represented by a change in voltage level. Thus, a string of zeros causes the NRZI data to toggle each bit time. A string of ones causes long periods with no transitions in the data.
In order to ensure adequate signal transitions, bit stuffing is employed by the transmitting device when sending a packet on USB. A zero is inserted after every six consecutive ones in the data stream before the data is NRZI encoded, to force a transition in the NRZI data stream. This gives the receiver logic a data transition at least once every seven bit times to guarantee the data and clock lock. Bit stuffing is enabled beginning with the synchronization pattern and throughout the entire transmission.
The receiver of the data must decode the NRZI data, recognize the stuffed bits and discard them. If the receiver sees seven consecutive ones anywhere in the data packet then a bit stuffing error has occurred and the packet should be ignored.
Bit stuffing is inherently serial in nature. This makes it difficult to implement bit stuffing at high data rates. Currently, the USB serial data rate is specified to be 12 Mb/sec. Under a contemplated revision to USB (USB 2.0) this data rate may increase by forty. This makes it difficult for prior art bit stuffing methods to be effective. What is needed is a new method of bit stuffing that can handle high data rates.
A parallel bit stuffing method acting on a stream of serial data is disclosed. The method receives an input data segment of a predetermined bit length from the stream of serial data. Next, an address field is formed by appending to the input data segment a carryover segment. Using a look-up table stored in read only memory (ROM), the address field is used to correlate to an output field. The output field includes a stuffed data portion and a carryover segment portion. The carryover segment portion is used in a next cycle as the carryover segment. Finally, the stuffed data portion is output as output data segments of predetermined bit length.